package com.pojo;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
//原型（多例）
//@Scope("prototype")
@ComponentScan
public class User {

    @PostConstruct
    public void init(){
        System.out.println("对象初始化");
    }

    @PreDestroy
    public void destory(){
        System.out.println("摧毁 ");
    }
}
